#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os

# 基础配置
DEBUG = True
PORT = 8888

# 数据库配置 (示例)
DATABASE_CONFIG = {
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "password",
    "database": "trytryme_db"
}

# Redis 配置 (示例)
REDIS_CONFIG = {
    "host": "localhost",
    "port": 6379,
    "db": 0,
    "password": None
}

# 日志配置
LOGGING_CONFIG = {
    "level": "INFO",
    "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    "file": "logs/app.log"
}

# 安全配置
SECURITY_CONFIG = {
    "secret_key": "your-secret-key-change-this-in-production",
    "session_timeout": 3600,  # 1小时
    "max_login_attempts": 5
}

# 应用设置
settings = {
    "debug": DEBUG,
    "cookie_secret": SECURITY_CONFIG["secret_key"],
    "xsrf_cookies": True,
    "login_url": "/login",
    "static_path": os.path.join(os.path.dirname(__file__), "static"),
    "template_path": os.path.join(os.path.dirname(__file__), "templates"),
}
